package org.stjs.generator.javascript;

import java.io.File;
import java.io.Writer;

import com.google.debugging.sourcemap.SourceMapGenerator;

/**
 * .
 * 
 * @author acraciun
 */
@SuppressWarnings("PMD.ExcessivePublicCount")
public interface JavaScriptBuilder<T> {
	T array(Iterable<T> values);

	T asExpressionList(Iterable<T> nodes);

	T assignment(AssignOperator operator, T left, T right);

	T binary(BinaryOperator operator, Iterable<T> operands);

	T block(Iterable<T> statements);

	T breakStatement(T label);

	T caseStatement(T expression, Iterable<T> statements);

	T catchClause(T varName, T body);

	T continueStatement(T label);

	T elementGet(T target, T index);

	T expressionStatement(T expr);

	T function(String name, Iterable<T> params, T body);

	T functionCall(T target, Iterable<T> arguments);

	T keyword(Keyword token);

	T name(CharSequence name);

	T label(CharSequence name);

	T newExpression(T target, Iterable<T> arguments);

	T object(Iterable<NameValue<T>> props);

	T paren(T expr);

	T position(T node, int javaLineNumber, int javaColumnNumber);

	T property(T target, CharSequence name);

	T string(String value);

	T unary(UnaryOperator operator, T operand);

	T variableDeclaration(boolean statement, Iterable<NameValue<T>> vars);

	T variableDeclaration(boolean statement, CharSequence name, T init);

	T doLoop(T condition, T body);

	T emptyStatement();

	T emptyExpression();

	T forInLoop(T iterator, T iterated, T body);

	T forLoop(T init, T condition, T update, T body);

	T ifStatement(T condition, T thenPart, T elsePart);

	T addStatement(T blockOrStatement, T statement);

	T addStatementBeginning(T blockOrStatement, T statement);

	T labeledStatement(T label, T statement);

	T returnStatement(T returnValue);

	T switchStatement(T expr, Iterable<T> cases);

	T tryStatement(T tryBlock, Iterable<T> catchClauses, T finallyBlock);

	T whileLoop(T condition, T body);

	T root(Iterable<T> children);

	T code(String code);

	String toString(T node);

	T conditionalExpression(T test, T trueExpr, T falseExpr);

	T character(String c);

	T number(Number n);

	T statements(Iterable<T> stmts);

	SourceMapGenerator writeJavaScript(T javascriptRoot, File inputFile,
			boolean generateSourceMap, Writer writer);

	T comment(T node, String comment);

	T throwStatement(T expr);
}
